package books.room;

import android.content.Context;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

import anime.room.HistoryDao;
import anime.room.HistoryDataBase;

@Database(entities = {BooksHistoryModel.class}, version = 1, exportSchema = false)
public abstract class BooksHistoryDataBase extends RoomDatabase {
    private static BooksHistoryDataBase mInstance;
    private static final String  DATABASE_NAME ="bookshistorys_db.db";

    public static synchronized BooksHistoryDataBase getInstance(Context context){
        if(mInstance==null){
            mInstance = Room.databaseBuilder(context.getApplicationContext(),
                    BooksHistoryDataBase.class,
                    DATABASE_NAME)
                    .build();
        }
        return mInstance;
    }

    public abstract BooksHistoryDao getStudentDao();
}
